package jdk8.functions;


import java.util.function.Supplier;

public class DemoSupplier {
    private static String getString(Supplier<String> supplier){
        return supplier.get();
    }

    public static void main(String[] args) {
        String msgA = "Hello";
        String msgB = "World";

        System.out.println("1----------" + getString(() -> msgA + msgB));
        System.out.println("2----------" + getString(String::new));
    }
}
